#pragma once

class ExportXSkinLib XMemCanvas
{
    XMemCanvas();
public:
    XMemCanvas(XCANVAS xCanvas, XIMAGE xBufferImage, const LPRECT prcClip);
    ~XMemCanvas();

    operator XCANVAS()
    {
        return m_hMemCanvas;
    }

    void Draw(const LPRECT prcPaint);

protected:
    void Init(XCANVAS xCanvas, XIMAGE xBufferImage, const LPRECT prcClip);
    void UnInit();

protected:
    XCANVAS m_hOrgCanvas;
    XCANVAS m_hMemCanvas;
    XIMAGE  m_hMemImage;
    HGDIOBJ m_hOldImage;
};